﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;

public partial class Admin_Setting_Database : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            txtOld.Text = ConfigurationManager.AppSettings["server"];
        }

    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        try
        {
            string sql = txtNew.Text;
            SqlConnection sqlcon = new SqlConnection(sql);
            sqlcon.Open();
            sqlcon.Close();


        }
        catch
        {
            lblMessage.Text = "数据库连接参数不正确";
        }
    }
}